<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
import ViewDetails from "./../viewDetails/index";
export default {
    mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
    components: {},
    data() {
        return {
            appWindow: window,
            // 开团列表
            list: [],
            loading: true,
        };
    },
    methods: {
        mixinTable_tableSearchData: {
            status: ""
        },
        // 开团详情
        async viewDetails(item) {
            ViewDetails.init({
                id: item.id,
            })
        },
        // 虚拟成团
        async group(_id) {
            let res = await this.$vFN.Http.post({
                url: "admin/active/virtualSuccess",
                data: {
                    team_id: _id,
                }
            }, window);
            if(res.code == 200) {
                this.$vFN.Tools.messageSuccess("操作成功");
                this.openList();
            }
        },
        // 开团列表
        async openList () {
            let res = await this.$vFN.Http.post({
                url: "admin/active/groupPage",
                data: {
                    active_id: this.id, // this.id, 活动页面传来的id
                }
            }, window);
            // console.log(res.data.list);
            this.list = res.data.list;
            if(res.code == 200) {
                this.loading = false;
            }
        },
        // 初始化
        async init() {
            this.mixinEdit_loading = true;
            await this.mixinEdit_editBoxInit({
                model: "form",
                id: this.id,
            });
            this.openList();
        },

        cancel() {
            this.mixinEdit_editVisible = false;
        }

    },
    mounted() {
        this.init();
    },
    activated() {},
};
</script>